const express = require("express");
var router = express.Router();
const { top_playlist,playlist_detail,song_detail,login_cellphone,cloudsearch,login_status,artist_album,album,playlist_catlist,toplist,artist_list,lyric} = require('NeteaseCloudMusicApi')



router.get('/top/playlist', function(req, res, next) {
    top_playlist({...req.query,cookie:req.cookies}).then((r) => {
        res.send(r.body)
    }).catch((r) => {
        res.send(r.body);
    })
});
router.get('/playlist/detail', function(req, res, next) {
    playlist_detail({...req.query,cookie:req.cookies}).then((r) => {
        res.send(r.body)
    }).catch((r) => {
        res.send(r.body);
    })
});

router.get('/song/detail', function(req, res, next) {
    song_detail({...req.query,cookie:req.cookies}).then((r) => {
        res.send(r.body)
    }).catch((r) => {
        res.send(r.body);
    })
});
router.get('/login/cellphone', function(req, res, next) {
    login_cellphone({...req.query,cookie:req.cookies}).then((r) => {
        res.send(r.body)
    }).catch((r) => {
        res.send(r.body);
    })
});

router.get('/cloudsearch', function(req, res, next) {
    cloudsearch({...req.query,cookie:req.cookies}).then((r) => {
        res.send(r.body)
    }).catch((r) => {
        res.send(r.body);
    })
});
router.get('/login/status', function(req, res, next) {
    login_status({...req.query,cookie:req.cookies}).then((r) => {
        res.send(r.body)
    }).catch((r) => {
        res.send(r.body);
    })
});
router.get('/artist/album', function(req, res, next) {
    artist_album({...req.query,cookie:req.cookies}).then((r) => {
        res.send(r.body)
    }).catch((r) => {
        res.send(r.body);
    })
});
router.get('/album', function(req, res, next) {
    album({...req.query,cookie:req.cookies}).then((r) => {
        res.send(r.body)
    }).catch((r) => {
        res.send(r.body);
    })
});
router.get('/playlist/catlist', function(req, res, next) {
    playlist_catlist({...req.query,cookie:req.cookies}).then((r) => {
        res.send(r.body)
    }).catch((r) => {
        res.send(r.body);
    })
});
router.get('/toplist', function(req, res, next) {
    toplist({...req.query,cookie:req.cookies}).then((r) => {
        res.send(r.body)
    }).catch((r) => {
        res.send(r.body);
    })
});

router.get('/artist/list', function(req, res, next) {
    artist_list({...req.query,cookie:req.cookies}).then((r) => {
        res.send(r.body)
    }).catch((r) => {
        res.send(r.body);
    })
});

router.get('/lyric', function(req, res, next) {
    lyric({...req.query,cookie:req.cookies}).then((r) => {
        res.send(r.body)
    }).catch((r) => {
        res.send(r.body);
    })
});

module.exports = router;
